<?php
    /**
     * Created by PhpStorm.
     * User: walker
     * FILE_NAME: common_helper.php
     * ProjectName: erp
     * Date: 2019/11/7
     * Time: 14:08
     */
    /**
     * json格式数据返回
     * @param       $code int
     * @param       $msg  string
     * @param array $data
     * author: walker
     * Date: 2019/11/7
     * Time: 14:14
     * Note:
     */
    function ajaxReturn($code, $msg, $data = array())
    {
        header('Content-type: application/json');
        $data = array(
            'code' => $code,
            'msg'  => $msg,
            'data' => $data,
        );
        echo json_encode($data, true);
        die();
    }